<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>">
    
    <title>博思后台内容管理系统-[登录]</title>
    <link type="text/css" href="<%=basePath%>style/bace.css" rel="stylesheet"/>
	<link type="text/css" href="<%=basePath%>style/block.css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/javascript/jquery-1.7.1.min.js"></script>
	<script type="text/javascript">
		function SetFocus() {
		if($("#username").value == '')
		  $("#username").focus();
		else
		  $("#username").select();
		}
		function dologin() {
			if ($("#username").val() == ""){
				alert("用户名不能为空！");
				$("#username").focus();
			} else {	
				$.ajax({
						url:"action/master/login/login.json",
						type:"post",
						data:"username="+$("#username").val()+"&password="+$("#password").val(),
						dataType:"json",
						success :function (data) {
							if(data.tag==1){
								location="<%=basePath%>"+data.url+"?Token="+data.Token;
							}else{
								$("#username").val(data.username);
								$("#password").val("");							
								$("#hint").html(data.Token);
							}						
						}
				});
			}
		}
	</script>
  </head>
  
  <body onload="SetFocus();">

<div class="content S_login_bg">
	<div class="col_main">
		<dl>
			<dt>用户名：</dt><dd><input type="text" name="username" id="username" maxlength="20" maxlength="30"></dd>
			<dt>密 码：</dt><dd><input type="password" name="password" id="password" maxlength="20" maxlength="30"></dd>
			<!-- <dt>验证码：</dt><dd><input class="code" type="text"/></dd> -->
		</dl>
		<div class="Bottom_all">
			<span><input class="Signin" type="submit" value="" onclick="dologin();"/></span><span><input class="Cancel" type="button"/></span>
		</div>
	</div>
</div>
<div class="content footer">
技术支持：福州博思软件技术有限公司 备案号：56565656<br/>
             CopyRight@2012

</div>
  </body>
</html>
